﻿@model ForumSettingsModel

@{
    //page title
    ViewBag.Title = T("Admin.Configuration.Settings.Forums").Text;
    //active menu item (system name)
    Html.SetActiveMenuItemSystemName("Forums settings");
}


<form asp-controller="Setting" asp-action="Forum" method="post">
    <div class="content-header clearfix">
        <h1 class="pull-left">
            @T("Admin.Configuration.Settings.Forums")
        </h1>
        <div class="pull-right">
            <button type="submit" name="save" class="btn bg-blue">
                <i class="fa fa-floppy-o"></i>
                @T("Admin.Common.Save")
            </button>
            @await Component.InvokeAsync("AdminWidget", new { widgetZone = "admin_forum_settings_buttons" })
        </div>
    </div>

    <div class="content">
        <div class="form-horizontal">
            @await Component.InvokeAsync("StoreScopeConfiguration")
            @await Component.InvokeAsync("SettingMode")
            <div asp-validation-summary="All"></div>

            <script type="text/javascript">
                $(document).ready(function () {
                    $("#@Html.IdFor(model => model.AllowPostVoting)").click(toggleAllowVoting);
                    $("#@Html.IdFor(model => model.AllowPrivateMessages)").click(toggleAllowPrivateMessages);
                    toggleAllowVoting();
                    toggleAllowPrivateMessages();
                });

                function toggleAllowVoting() {
                    if ($('#@Html.IdFor(model => model.AllowPostVoting)').is(':checked')) {
                        $('#pnlMaxVotes').show();
                    }
                    else {
                        $('#pnlMaxVotes').hide();
                    }
                }

                function toggleAllowPrivateMessages() {
                    if ($('#@Html.IdFor(model => model.AllowPrivateMessages)').is(':checked')) {
                        $('#pnlShowAlertForPM').show();
                        $('#pnlNotifyAboutPrivateMessages').show();
                    }
                    else {
                        $('#pnlShowAlertForPM').hide();
                        $('#pnlNotifyAboutPrivateMessages').hide();
                    }
                }
            </script>

            <div class="panel-group">
                @await Component.InvokeAsync("AdminWidget", new { widgetZone = "admin_forum_settings_top" })
                <div class="panel panel-default">
                    <div class="panel-heading">
                        @T("Admin.Configuration.Settings.Forums.BlockTitle.Common")
                    </div>
                    <div class="panel-body">
                        <div class="form-group">
                            <div class="col-md-3">
                                <nop-override-store-checkbox asp-for="ForumsEnabled_OverrideForStore" asp-input="ForumsEnabled" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                                <nop-label asp-for="ForumsEnabled" />
                            </div>
                            <div class="col-md-9">
                                <nop-editor asp-for="ForumsEnabled" />
                                <span asp-validation-for="ForumsEnabled"></span>
                            </div>
                        </div>
                        <div class="form-group advanced-setting">
                            <div class="col-md-3">
                                <nop-override-store-checkbox asp-for="RelativeDateTimeFormattingEnabled_OverrideForStore" asp-input="RelativeDateTimeFormattingEnabled" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                                <nop-label asp-for="RelativeDateTimeFormattingEnabled" />
                            </div>
                            <div class="col-md-9">
                                <nop-editor asp-for="RelativeDateTimeFormattingEnabled" />
                                <span asp-validation-for="RelativeDateTimeFormattingEnabled"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-3">
                                <nop-override-store-checkbox asp-for="SignaturesEnabled_OverrideForStore" asp-input="SignaturesEnabled" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                                <nop-label asp-for="SignaturesEnabled" />
                            </div>
                            <div class="col-md-9">
                                <nop-editor asp-for="SignaturesEnabled" />
                                <span asp-validation-for="SignaturesEnabled"></span>
                            </div>
                        </div>
                        <div class="form-group advanced-setting">
                            <div class="col-md-3">
                                <nop-override-store-checkbox asp-for="ShowCustomersPostCount_OverrideForStore" asp-input="ShowCustomersPostCount" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                                <nop-label asp-for="ShowCustomersPostCount" />
                            </div>
                            <div class="col-md-9">
                                <nop-editor asp-for="ShowCustomersPostCount" />
                                <span asp-validation-for="ShowCustomersPostCount"></span>
                            </div>
                        </div>
                        <div class="form-group advanced-setting">
                            <div class="col-md-3">
                                <nop-override-store-checkbox asp-for="ForumEditor_OverrideForStore" asp-input="ForumEditor" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                                <nop-label asp-for="ForumEditor" />
                            </div>
                            <div class="col-md-9">
                                <nop-select asp-for="ForumEditor" asp-items="Model.ForumEditorValues" />
                                <span asp-validation-for="ForumEditor"></span>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="panel panel-default">
                    <div class="panel-heading">
                        @T("Admin.Configuration.Settings.Forums.BlockTitle.Permissions")
                    </div>
                    <div class="panel-body">
                        <div class="form-group advanced-setting">
                            <div class="col-md-3">
                                <nop-override-store-checkbox asp-for="AllowGuestsToCreatePosts_OverrideForStore" asp-input="AllowGuestsToCreatePosts" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                                <nop-label asp-for="AllowGuestsToCreatePosts" />
                            </div>
                            <div class="col-md-9">
                                <nop-editor asp-for="AllowGuestsToCreatePosts" />
                                <span asp-validation-for="AllowGuestsToCreatePosts"></span>
                            </div>
                        </div>
                        <div class="form-group advanced-setting">
                            <div class="col-md-3">
                                <nop-override-store-checkbox asp-for="AllowGuestsToCreateTopics_OverrideForStore" asp-input="AllowGuestsToCreateTopics" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                                <nop-label asp-for="AllowGuestsToCreateTopics" />
                            </div>
                            <div class="col-md-9">
                                <nop-editor asp-for="AllowGuestsToCreateTopics" />
                                <span asp-validation-for="AllowGuestsToCreateTopics"></span>
                            </div>
                        </div>
                        <div class="form-group advanced-setting">
                            <div class="col-md-3">
                                <nop-override-store-checkbox asp-for="AllowCustomersToEditPosts_OverrideForStore" asp-input="AllowCustomersToEditPosts" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                                <nop-label asp-for="AllowCustomersToEditPosts" />
                            </div>
                            <div class="col-md-9">
                                <nop-editor asp-for="AllowCustomersToEditPosts" />
                                <span asp-validation-for="AllowCustomersToEditPosts"></span>
                            </div>
                        </div>
                        <div class="form-group advanced-setting">
                            <div class="col-md-3">
                                <nop-override-store-checkbox asp-for="AllowCustomersToDeletePosts_OverrideForStore" asp-input="AllowCustomersToDeletePosts" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                                <nop-label asp-for="AllowCustomersToDeletePosts" />
                            </div>
                            <div class="col-md-9">
                                <nop-editor asp-for="AllowCustomersToDeletePosts" />
                                <span asp-validation-for="AllowCustomersToDeletePosts"></span>
                            </div>
                        </div>
                        <div class="form-group advanced-setting">
                            <div class="col-md-3">
                                <nop-override-store-checkbox asp-for="AllowCustomersToManageSubscriptions_OverrideForStore" asp-input="AllowCustomersToManageSubscriptions" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                                <nop-label asp-for="AllowCustomersToManageSubscriptions" />
                            </div>
                            <div class="col-md-9">
                                <nop-editor asp-for="AllowCustomersToManageSubscriptions" />
                                <span asp-validation-for="AllowCustomersToManageSubscriptions"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-3">
                                <nop-override-store-checkbox asp-for="AllowPostVoting_OverrideForStore" asp-input="AllowPostVoting" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                                <nop-label asp-for="AllowPostVoting" />
                            </div>
                            <div class="col-md-9">
                                <nop-editor asp-for="AllowPostVoting" />
                                <span asp-validation-for="AllowPostVoting"></span>
                            </div>
                        </div>
                        <nop-nested-setting asp-for="AllowPostVoting">
                            <div class="form-group advanced-setting" id="pnlMaxVotes">
                                <div class="col-md-3">
                                    <nop-override-store-checkbox asp-for="MaxVotesPerDay_OverrideForStore" asp-input="MaxVotesPerDay" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                                    <nop-label asp-for="MaxVotesPerDay" />
                                </div>
                                <div class="col-md-9">
                                    <nop-editor asp-for="MaxVotesPerDay" />
                                    <span asp-validation-for="MaxVotesPerDay"></span>
                                </div>
                            </div>
                        </nop-nested-setting>
                        <div class="form-group">
                            <div class="col-md-3">
                                <nop-override-store-checkbox asp-for="AllowPrivateMessages_OverrideForStore" asp-input="AllowPrivateMessages" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                                <nop-label asp-for="AllowPrivateMessages" />
                            </div>
                            <div class="col-md-9">
                                <nop-editor asp-for="AllowPrivateMessages" />
                                <span asp-validation-for="AllowPrivateMessages"></span>
                            </div>
                        </div>
                        <nop-nested-setting asp-for="AllowPrivateMessages">
                            <div class="form-group advanced-setting" id="pnlShowAlertForPM">
                                <div class="col-md-3">
                                    <nop-override-store-checkbox asp-for="ShowAlertForPM_OverrideForStore" asp-input="ShowAlertForPM" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                                    <nop-label asp-for="ShowAlertForPM" />
                                </div>
                                <div class="col-md-9">
                                    <nop-editor asp-for="ShowAlertForPM" />
                                    <span asp-validation-for="ShowAlertForPM"></span>
                                </div>
                            </div>
                            <div class="form-group advanced-setting" id="pnlNotifyAboutPrivateMessages">
                                <div class="col-md-3">
                                    <nop-override-store-checkbox asp-for="NotifyAboutPrivateMessages_OverrideForStore" asp-input="NotifyAboutPrivateMessages" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                                    <nop-label asp-for="NotifyAboutPrivateMessages" />
                                </div>
                                <div class="col-md-9">
                                    <nop-editor asp-for="NotifyAboutPrivateMessages" />
                                    <span asp-validation-for="NotifyAboutPrivateMessages"></span>
                                </div>
                            </div>
                        </nop-nested-setting>
                    </div>
                </div>
                <div class="panel panel-default advanced-setting">
                    <div class="panel-heading">
                        @T("Admin.Configuration.Settings.Forums.BlockTitle.PageSizes")
                    </div>
                    <div class="panel-body">
                        <div class="form-group">
                            <div class="col-md-3">
                                <nop-override-store-checkbox asp-for="TopicsPageSize_OverrideForStore" asp-input="TopicsPageSize" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                                <nop-label asp-for="TopicsPageSize" />
                            </div>
                            <div class="col-md-9">
                                <nop-editor asp-for="TopicsPageSize" />
                                <span asp-validation-for="TopicsPageSize"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-3">
                                <nop-override-store-checkbox asp-for="PostsPageSize_OverrideForStore" asp-input="PostsPageSize" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                                <nop-label asp-for="PostsPageSize" />
                            </div>
                            <div class="col-md-9">
                                <nop-editor asp-for="PostsPageSize" />
                                <span asp-validation-for="PostsPageSize"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-3">
                                <nop-override-store-checkbox asp-for="SearchResultsPageSize_OverrideForStore" asp-input="SearchResultsPageSize" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                                <nop-label asp-for="SearchResultsPageSize" />
                            </div>
                            <div class="col-md-9">
                                <nop-editor asp-for="SearchResultsPageSize" />
                                <span asp-validation-for="SearchResultsPageSize"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-3">
                                <nop-override-store-checkbox asp-for="ActiveDiscussionsPageSize_OverrideForStore" asp-input="ActiveDiscussionsPageSize" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                                <nop-label asp-for="ActiveDiscussionsPageSize" />
                            </div>
                            <div class="col-md-9">
                                <nop-editor asp-for="ActiveDiscussionsPageSize" />
                                <span asp-validation-for="ActiveDiscussionsPageSize"></span>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="panel panel-default advanced-setting">
                    <div class="panel-heading">
                        @T("Admin.Configuration.Settings.Forums.BlockTitle.Feeds")
                    </div>
                    <div class="panel-body">
                        <div class="form-group">
                            <div class="col-md-3">
                                <nop-override-store-checkbox asp-for="ForumFeedsEnabled_OverrideForStore" asp-input="ForumFeedsEnabled" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                                <nop-label asp-for="ForumFeedsEnabled" />
                            </div>
                            <div class="col-md-9">
                                <nop-editor asp-for="ForumFeedsEnabled" />
                                <span asp-validation-for="ForumFeedsEnabled"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-3">
                                <nop-override-store-checkbox asp-for="ForumFeedCount_OverrideForStore" asp-input="ForumFeedCount" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                                <nop-label asp-for="ForumFeedCount" />
                            </div>
                            <div class="col-md-9">
                                <nop-editor asp-for="ForumFeedCount" />
                                <span asp-validation-for="ForumFeedCount"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-3">
                                <nop-override-store-checkbox asp-for="ActiveDiscussionsFeedEnabled_OverrideForStore" asp-input="ActiveDiscussionsFeedEnabled" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                                <nop-label asp-for="ActiveDiscussionsFeedEnabled" />
                            </div>
                            <div class="col-md-9">
                                <nop-editor asp-for="ActiveDiscussionsFeedEnabled" />
                                <span asp-validation-for="ActiveDiscussionsFeedEnabled"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-3">
                                <nop-override-store-checkbox asp-for="ActiveDiscussionsFeedCount_OverrideForStore" asp-input="ActiveDiscussionsFeedCount" asp-store-scope="@Model.ActiveStoreScopeConfiguration" />
                                <nop-label asp-for="ActiveDiscussionsFeedCount" />
                            </div>
                            <div class="col-md-9">
                                <nop-editor asp-for="ActiveDiscussionsFeedCount" />
                                <span asp-validation-for="ActiveDiscussionsFeedCount"></span>
                            </div>
                        </div>
                    </div>
                </div>
                @await Component.InvokeAsync("AdminWidget", new { widgetZone = "admin_forum_settings_bottom" })
            </div>
        </div>
    </div>
</form>